@import './variables.scss';
@import './mixins.scss';

// 全局样式重置
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: $font-size-sm;
  line-height: 1.4;
  color: $text-color;
  background-color: $bg-color;
}

// 全局重置 - 去除默认间距
#app {
  margin: 0;
  padding: 0;
}

// Ant Design 组件样式覆盖
.ant-layout {
  background: #fff !important;
}

.ant-card {
  border: 1px solid #f0f0f0 !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  
  .ant-card-head {
    background: #fafafa !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 12px 16px !important;
    min-height: auto !important;
  }
  
  .ant-card-body {
    padding: 16px !important;
  }
}

.ant-table {
  .ant-table-thead > tr > th {
    background: #fafafa !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
  }
  
  .ant-table-tbody > tr > td {
    border-bottom: 1px solid #f5f5f5 !important;
    padding: 8px 12px !important;
  }
}

.ant-btn {
  border: 1px solid #d9d9d9 !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  
  &.ant-btn-primary {
    background: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
  }
  
  &.ant-btn-default {
    background: #fff !important;
    color: #000 !important;
  }
}

.ant-input,
.ant-input-password {
  border: 1px solid #d9d9d9 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

.ant-select {
  .ant-select-selector {
    border: 1px solid #d9d9d9 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
  }
}

// 通用工具类
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: $primary-color; }
.text-success { color: $success-color; }
.text-warning { color: $warning-color; }
.text-error { color: $error-color; }
.text-secondary { color: $text-color-secondary; }
.text-light { color: $text-color-light; }

// 字体大小
.text-xs { font-size: $font-size-xs; }
.text-sm { font-size: $font-size-sm; }
.text-base { font-size: $font-size-base; }
.text-lg { font-size: $font-size-lg; }
.text-xl { font-size: $font-size-xl; }
.text-xxl { font-size: $font-size-xxl; }

// 字体粗细
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

// 间距
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mr-0 { margin-right: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }

.m-xs { margin: $spacing-xs; }
.mt-xs { margin-top: $spacing-xs; }
.mr-xs { margin-right: $spacing-xs; }
.mb-xs { margin-bottom: $spacing-xs; }
.ml-xs { margin-left: $spacing-xs; }

.m-sm { margin: $spacing-sm; }
.mt-sm { margin-top: $spacing-sm; }
.mr-sm { margin-right: $spacing-sm; }
.mb-sm { margin-bottom: $spacing-sm; }
.ml-sm { margin-left: $spacing-sm; }

.m-base { margin: $spacing-base; }
.mt-base { margin-top: $spacing-base; }
.mr-base { margin-right: $spacing-base; }
.mb-base { margin-bottom: $spacing-base; }
.ml-base { margin-left: $spacing-base; }

.m-lg { margin: $spacing-lg; }
.mt-lg { margin-top: $spacing-lg; }
.mr-lg { margin-right: $spacing-lg; }
.mb-lg { margin-bottom: $spacing-lg; }
.ml-lg { margin-left: $spacing-lg; }

.p-0 { padding: 0; }
.pt-0 { padding-top: 0; }
.pr-0 { padding-right: 0; }
.pb-0 { padding-bottom: 0; }
.pl-0 { padding-left: 0; }

.p-xs { padding: $spacing-xs; }
.pt-xs { padding-top: $spacing-xs; }
.pr-xs { padding-right: $spacing-xs; }
.pb-xs { padding-bottom: $spacing-xs; }
.pl-xs { padding-left: $spacing-xs; }

.p-sm { padding: $spacing-sm; }
.pt-sm { padding-top: $spacing-sm; }
.pr-sm { padding-right: $spacing-sm; }
.pb-sm { padding-bottom: $spacing-sm; }
.pl-sm { padding-left: $spacing-sm; }

.p-base { padding: $spacing-base; }
.pt-base { padding-top: $spacing-base; }
.pr-base { padding-right: $spacing-base; }
.pb-base { padding-bottom: $spacing-base; }
.pl-base { padding-left: $spacing-base; }

.p-lg { padding: $spacing-lg; }
.pt-lg { padding-top: $spacing-lg; }
.pr-lg { padding-right: $spacing-lg; }
.pb-lg { padding-bottom: $spacing-lg; }
.pl-lg { padding-left: $spacing-lg; }

// Flex布局
.flex { @include flex(); }
.flex-col { @include flex(column); }
.flex-center { @include flex(row, center, center); }
.flex-between { @include flex(row, space-between, center); }
.flex-around { @include flex(row, space-around, center); }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1; }

// 显示/隐藏
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

// 位置
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

// 溢出
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

// 文本省略
.ellipsis { @include text-ellipsis(); }
.ellipsis-2 { @include text-ellipsis(2); }
.ellipsis-3 { @include text-ellipsis(3); }

// 圆角
.rounded-sm { border-radius: $border-radius-sm; }
.rounded { border-radius: $border-radius-base; }
.rounded-lg { border-radius: $border-radius-lg; }
.rounded-xl { border-radius: $border-radius-xl; }
.rounded-full { border-radius: 50%; }

// 阴影
.shadow-sm { box-shadow: $box-shadow-sm; }
.shadow { box-shadow: $box-shadow-base; }
.shadow-lg { box-shadow: $box-shadow-lg; }
.shadow-none { box-shadow: none; }

// 过渡动画
.transition { @include transition(); }
.transition-fast { @include transition(all, 0.15s); }
.transition-slow { @include transition(all, 0.5s); }

// 卡片样式
.card {
  @include card();
}

.card-sm {
  @include card($spacing-sm, $border-radius-sm, $box-shadow-sm);
}

.card-lg {
  @include card($spacing-lg, $border-radius-lg, $box-shadow-lg);
}